<?php

//ini_set("display_errors", 1);
//error_reporting(E_ALL);

// ini_set("memory_limit", "16M");
// ini_set("register_globals", "on");

define("MY_SESSION_VAR_NAME", "_MY_SESSION");

session_start();

// save session variables before destruction by VCL
$_MYSESSION = $_SESSION[MY_SESSION_VAR_NAME];

// provoke the VCL to kill the session
$_GET['restore_session'] = "1";

// access functions for session variables
function SetSessionVar($aVarName, $aValue)
{
   $_SESSION[MY_SESSION_VAR_NAME][$aVarName] = $aValue;
}

function GetSessionVar($aVarName)
{
   return $_SESSION[MY_SESSION_VAR_NAME][$aVarName];
}

//Includes
require_once("vcl/vcl.inc.php");
use_unit("comctrls.inc.php");
use_unit("menus.inc.php");
use_unit("forms.inc.php");
use_unit("extctrls.inc.php");
use_unit("stdctrls.inc.php");
use_unit("rtl.inc.php");

// restore SESSION variables so that they survive the next page load
$_SESSION[MY_SESSION_VAR_NAME] = $_MYSESSION;

//Class definition
class MasterPage extends Page
{
   public $pnlMenu = null;
   public $lbRegister = null;
   public $lbBrowse = null;
   public $lbSearch = null;
   public $lbManage = null;
   public $imgHeader = null;
   public $lbMessage = null;

   function lbRegisterClick($sender, $params)
   {

      redirect("AdminDoRegister.php");

   }

   function lbManageClick($sender, $params)
   {

      redirect("AdminDoLogin.php");

   }

   function lbBrowseClick($sender, $params)
   {

      redirect("Category.php");

   }

   function lbSearchClick($sender, $params)
   {

      redirect("Search.php");

   }

}

global $application;

global $MasterPage;

//Creates the form
$MasterPage = new MasterPage($application);

//Read from resource file
$MasterPage->loadResource(__FILE__);

//Shows the form
$MasterPage->show();

?>